<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 
<%@ page import="org.jamwiki.model.*,org.jamwiki.utils.*" %>
<%@ include file="include.jsp"%>
<%@ page import="org.jamwiki.*" %> 
<%
List userList = (List)request.getAttribute("items");
String title = session.getAttribute("title")+"";
String jump = session.getAttribute("jump")+"";
String category = request.getAttribute("category")+"";
String type = request.getParameter("type"); 
if(type==null)
	type="public";
String num = request.getParameter("num");
String offset = request.getParameter("offset");
int rowNum = 0;
if(null != offset && !"null".equalsIgnoreCase(offset) && !"".equals(offset)){
	rowNum = Integer.parseInt(offset);
} 
String categoryName = "";
String categoryId = request.getParameter("categoryId");
if(null != categoryId && !"null".equalsIgnoreCase(categoryId)){
	categoryName = WikiBase.getDataHandler().getCategoryById(Integer.parseInt(categoryId));
}
if(null == categoryName)
	categoryName = "";

%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 <style type="text/css">
	 body{
	  width:100%;
	  height:100%;
	 }
	 </style>
	 <script type="text/javascript">
	    function addRole(id){
	    	openwindow("<%=request.getContextPath()%>/wiki/role.jsp?userId="+id,'500','260','');

	    }
	    function catalogManage(){ 
	       window.location.href="<%=request.getContextPath()%>/wiki/catalog.jsp";
	    }
	    function redirctParent(){
	       parent.location.href="<%=path %>/en/Special:user?function=userList";
	    }
	    function addSame(id,name){ 
	    if("" == form1.categoryName.value){
     alert("目录名称不能为空");
   
   }else{
  window.location.href="samelevel.jsp?categoryId=" + id +"&categoryName="+name;
}
}
function addSub(id,name){
if("" == form1.categoryName.value){
     alert("目录名称不能为空");
   
   }else{
  window.location.href="categorysub.jsp?categoryId=" + id + "&categoryName="+name;
  }
}
function saveData(){
   if("" == form1.categoryName.value){
     alert("分类名称不能为空");
   
   }else{
     form1.submit();
   }


}
	    
	 </script>
	 
  </head>
  <body   leftmargin="0"  topmargin="0"  marginwidth="0" marginheight="0" class="table-right"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="36" align="left" valign="bottom" background="<%=imagePath %>right-bg.gif">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="0" class="word-orange">&nbsp;</td>
                <td width="98%" align="left" class="word-orange">您所在位置： 
                <a href="javaScript:redirctParent()" class="txt-blue"  target='_self' style="color:#e27e1b; ">系统管理</a> &gt; 
                 目录管理  </td>
              </tr>
           
		</table>
            </td>
        </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="center"><img src="<%=imagePath %>right-line.gif" width="98%" height="9" /></td>
          </tr>
        </table> 
        <table width="98%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="2%" align="center">&nbsp;</td>
            <td width="9%" align="center">&nbsp;</td>
            <td width="2%" align="center">&nbsp;</td> 
            <td width="50%" align="right"><a href="javaScript:onclick=redirctParent()"   class="<%if("public".equals(type)){ %>txt-blue<%}else{ %><%} %>"><span style="font:bold">授权管理</span></a></td>
          </tr>
        </table>   
          <form name ="form1" action="wiki/do.jsp?type=new" method="post">
     <div align="center">
		  <table width="98%" border="0" cellspacing="0" cellpadding="0">
		          <tr>
		            <td width="9"><img src="<%=imagePath %>tanchu_01.jpg" width="9" height="28" /></td>
		            <td align="center" background="<%=imagePath %>tanchu_02.jpg"><strong>目录管理</strong></td>
		            <td width="10"><img src="<%=imagePath %>tanchu_03.jpg" width="10" height="28" /></td>
		          </tr>
		        </table>
		        <table width="98%" border="0" cellspacing="0" cellpadding="0">
		          <tr>
		            <td width="9" background="<%=imagePath %>tanchu_04.jpg">&nbsp;</td>
		            <td bgcolor="eaeef7"><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
		                <tr>
		                  <td width="16%" height="27" bgcolor="d9e1f3" class="underlin-heavygray">&nbsp;</td>
		                  <td width="84%" align="right" bgcolor="d9e1f3" class="underlin-heavygray">
		                  <img src="<%=imagePath %>zj.gif" style="cursor: hand" onclick="addSame('<%=categoryId%>','<%=categoryName%>');" width="16" height="16" align="absmiddle" />&nbsp;增加同级分类&nbsp;&nbsp;&nbsp;
		                  <img src="<%=imagePath %>zj.gif" onclick="addSub('<%=categoryId%>','<%=categoryName%>');" style="cursor: hand" width="16" height="16" align="absmiddle" />&nbsp;增加子分类</td>
		                </tr>
		                <tr>
		                  <td width="16%" height="27" bgcolor="d9e1f3" class="underlin-heavygray">&nbsp;</td>
		                  <td width="84%" align="center" bgcolor="d9e1f3" class="underlin-heavygray"><strong>新增【<%=categoryName%>】同级目录</strong></td>
		                </tr>
		                <tr>
		                  <td height="30" class="underlin-heavygray">目录名称：</td>
		                  <td align="left" class="underlin-heavygray"><input type="text" size="60" value="<%=categoryName%>" style="" name="categoryName"><input type="hidden" name="categoryId" value="<%=categoryId%>"></td>
		                </tr>
		              </table>
		              <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
		                  
		                  <tr>
		                    <td align="center"><input type="button" onclick="saveData()" value="保存">&nbsp;&nbsp;<input type="button" onclick="window.close()" value="取消"></td>
		                  </tr>
		              </table></td>
		            <td width="10"><img src="<%=imagePath %>tanchu_06.jpg" width="10" height="120" /></td>
		          </tr>
		        </table>
		        <table width="98%" border="0" cellspacing="0" cellpadding="0">
		          <tr>
		            <td width="9"><img src="<%=imagePath %>tanchu_07.jpg" width="9" height="9" /></td>
		            <td width="" background="<%=imagePath %>tanchu_08.jpg"><img src="<%=imagePath %>tanchu_08.jpg" width="204" height="9" /></td>
		            <td width="10"><img src="<%=imagePath %>tanchu_09.jpg" width="10" height="9" /></td>
		          </tr>
		        </table>
		      </div>
  </form>
  </body>
</html>
